//
//  WeatherTableViewCell.m
//  WeatherOFChangsha
//
//  Created by zkingsoft on 15/12/16.
//  Copyright (c) 2015年 zkingsoft. All rights reserved.
//

#import "WeatherTableViewCell.h"



@interface WeatherTableViewCell(){
    UILabel         *_weatherWeekLabel;
    UIImageView     *_weatherImageView;
    UILabel         *_weatherTempLabel;
    UILabel         *_weatherWeekWeatherLabel;
}

@end

@implementation WeatherTableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self AddAllSubView];
    }
    
    return self;
}

- (void)AddAllSubView{
    // 星期
    _weatherWeekLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_weatherWeekLabel];
    _weatherWeekLabel.font = [UIFont systemFontOfSize:20];
    _weatherWeekLabel.text = @"星期";
    [_weatherWeekLabel makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(80);
        make.width.equalTo(50);
        make.left.equalTo(self.contentView.left).offset(6);
        make.bottom.equalTo(self.contentView.bottom);
    }];
    
    // 图片
    _weatherImageView = [[UIImageView alloc] init];
    [self.contentView addSubview:_weatherImageView];
    [_weatherImageView makeConstraints:^(MASConstraintMaker *make) {
        make.width.equalTo(50);
        make.height.equalTo(50);
        make.left.equalTo(_weatherWeekLabel.right).offset(16);
        make.bottom.equalTo(_weatherWeekLabel.bottom).offset(-15);
    }];
    
    
    // 气温
    _weatherTempLabel = [[UILabel alloc] init];
    _weatherTempLabel.text = @"气温";
    [self.contentView addSubview:_weatherTempLabel];
    [_weatherTempLabel makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(80);
        make.width.equalTo(80);
        make.bottom.equalTo(_weatherWeekLabel.bottom);
        make.right.equalTo(self.contentView.right).offset(-6);
    }];
    
    // 天气情况
    _weatherWeekWeatherLabel = [[UILabel alloc] init];
    [self.contentView addSubview:_weatherWeekWeatherLabel];
    _weatherWeekWeatherLabel.text = @"天气情况";
    [_weatherWeekWeatherLabel makeConstraints:^(MASConstraintMaker *make) {
        make.height.equalTo(80);
        make.width.equalTo(100);
        make.bottom.equalTo(_weatherWeekLabel.bottom);
        make.right.equalTo(_weatherTempLabel.left).offset(-20);
    }];
}

- (void)awakeFromNib {
    // Initialization code
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
